//
//  UIButton+RoundedCorner.m
//  OilWear
//
//  Created by jjkj on 17/7/10.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "UIButton+RoundedCorner.h"

@implementation UIButton (RoundedCorner)
//切全部圆角
- (void)addRounedCornerWithRadius:(CGFloat)radious {
    self.layer.cornerRadius = radious;
    self.clipsToBounds = YES;
}
//切半圆角
- (void)changeButtonRadius:(CGSize )size rectCorner:(UIRectCorner)rectCorner {
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:rectCorner cornerRadii:size];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.bounds;
    maskLayer.path = maskPath.CGPath;
    self.layer.mask = maskLayer;
}
@end
